#include "trivial_functions.h"

#include <QCoreApplication>
#include <QDesktopServices>
#include <QUrl>

TrivialFunctions::TrivialFunctions(QObject *parent)
    : QObject(parent)
{

}

void TrivialFunctions::wakeUserManual(QString langStr)
{
    //langStr: en, zh
    if(langStr == "zh"){
        QString pdfDir = QCoreApplication::applicationDirPath();
        pdfDir = "file:///" + pdfDir + "/doc/maunl_zh.pdf";
        QUrl url(pdfDir.toLocal8Bit());
        QDesktopServices::openUrl(url);
    }else{
        QString pdfDir = QCoreApplication::applicationDirPath();
        pdfDir = "file:///" + pdfDir + "/doc/maunl_en.pdf";
        QUrl url(pdfDir.toLocal8Bit());
        QDesktopServices::openUrl(url);
    }
}
